using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using System.Data.SqlClient;
using System.Data.Common;

public partial class DBAContactAdd : System.Web.UI.Page
{
    Microsoft.Practices.EnterpriseLibrary.Data.Database db = DatabaseFactory.CreateDatabase("Application_Data");

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
        }

    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        DbCommand dbCommand = db.GetSqlStringCommand("INSERT INTO DBAContact (DBAContactName,DBAOfficePhone,DBAMobilePhone,DBAHomePhone,DBAContactEMail,DBAOnCallContactEMail,DBANotificationFlag,DBAOnCallFlag) VALUES(" +
                                                         "'" + this.txtDBAContactName.Text.ToString() + "'," +
                                                         "'" + this.txtDBAOfficePhone.Text.ToString() + "'," +
                                                         "'" + this.txtDBAMobilePhone.Text.ToString() + "'," +
                                                         "'" + this.txtDBAHomePhone.Text.ToString() + "'," +
                                                         "'" + this.txtDBAContactEmail.Text.ToString() + "'," +
                                                         "'" + this.txtDBAOnCallContactEmail.Text.ToString() + "'," +
                                                         "'" + Convert.ToBoolean(this.chkboxDBANotificationFlag.Checked) + "'," +
                                                         "'" + Convert.ToBoolean(this.chkboxDBAOnCallFlag.Checked) + "')");
        db.ExecuteNonQuery(dbCommand);

        Response.Redirect("~/siteadministration.aspx");
    }
}
